<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/resources/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:au="http://java.sun.com/jsf/composite/autocomplete">

    <ui:define name="content">
        <h:form>
            <p:panel header="Staff Shift">
                <h:panelGrid columns="2" >
                    <p:panel header="Staff Shift Details">
                        <h:panelGrid columns="2">
                            <h:outputLabel value="Staff : "/>
                            <au:completeStaff value="#{staffShiftController.staffshift.staff}"/>

                            <h:outputLabel value="ID"/>
                            <h:outputLabel id="lblId1" value="#{staffShiftController.staffshift.id}">
                            </h:outputLabel>

                             <h:outputLabel value="Shift Name"/>
                             <h:outputLabel  value="#{staffShiftController.staffshift.shift.name}">
                            </h:outputLabel>


                            <h:outputLabel value="Shift Date"/>
                            <p:calendar id="toDate" value="#{staffShiftController.staffshift.shiftDate}"
                                        pattern="dd MM yy">
                            </p:calendar>

                            <h:outputLabel value="Shift Start Time"/>
                            <p:calendar value="#{staffShiftController.staffshift.shiftStartTime}"
                                        pattern="yyyy MM dd hh:mm:ss">
                            </p:calendar>

                            <h:outputLabel value="Shift End Time"/>
                            <p:calendar value="#{staffShiftController.staffshift.shiftEndTime}"
                                        pattern="yyyy MM dd hh:mm:ss">
                            </p:calendar>

                            <h:outputLabel value="Multiply"/>
                            <p:inputText value="#{staffShiftController.staffshift.multiplyingFactorOverTime}"/>

                            <h:outputLabel value="Basi Per Sec"/>
                            <p:inputText value="#{staffShiftController.staffshift.overTimeValuePerSecond}"/>

                            <h:outputLabel value="Slary Mul Factor"/>
                            <p:inputText value="#{staffShiftController.staffshift.multiplyingFactorSalary}"/>

                            <h:outputLabel value="Leave Type"/>
                            <p:inputText value="#{staffShiftController.staffshift.leaveType}"/>


                            <h:outputLabel value="Roster"/>
                            <p:autoComplete completeMethod="#{rosterController.completeRoster}" value="#{staffShiftController.staffshift.roster}" forceSelection="true"
                                            var="ros" itemLabel="#{ros.name}" itemValue="#{ros}"></p:autoComplete>

                            <h:outputLabel value="Delete StaffShift: "/>
                            <h:selectBooleanCheckbox value="#{staffShiftController.staffshift.retired}" />

                            <h:panelGroup>
                                <p:commandButton id="btnAdd" ajax="false" value="Save" 
                                                 action="#{staffShiftController.saveStaffShift()}"/>
                            </h:panelGroup>                     
                        </h:panelGrid>
                    </p:panel> 
                </h:panelGrid>              
            </p:panel>
        </h:form>
    </ui:define> 

</ui:composition>
